<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
include_once '../Login/databaseconnection.php';

if(!loggedin())
{
	require_once '../index.php';
}
   
   else
   {
$Lab_Id=$_POST['Lab_Id'];

   $School_Id=$_POST['School_Id'];
      $Tp_Number=$_POST['Tp_Number'];
    $Account_Number=$_POST['Account_Number'];
$Date_of_commencement=$_POST['Date_of_commencement'];
	$Availability_Of_LAN=$_POST['Availability_Of_LAN'];
   $LAN_Supplier=$_POST['LAN_Supplier'];
 $Source_Of_Power=$_POST['Source_Of_Power'];
    $Supplied_Date=$_POST['Supplied_Date'];
   $Speed_Of_WAN=$_POST['Speed_Of_WAN'];
   $WAN_Connection_Type=$_POST['WAN_Connection_Type'];
	$Internet_Facilities=$_POST['Internet_Facilities'];

if($Lab_Id!=""&&$School_Id!=""&&$Source_Of_Power!=""&&$Tp_Number!=""&&$Account_Number!=""&&$Date_of_commencement!=""&&$Availability_Of_LAN!=""&&$LAN_Supplier!=""&&$Speed_Of_WAN!=""&&$Supplied_Date!=""&&$WAN_Connection_Type!=""&&$Internet_Facilities!="")
	{
$sqllab=mysql_query("INSERT INTO lab(Lab_Id,School_Id,Source_Of_Power,Tp_Number,Account_Number,Date_of_commencement)values('$Lab_Id','$School_Id','$Source_Of_Power','$Tp_Number','$Account_Number','$Date_of_commencement')");
if($sqllab)
  {
$_SESSION['error']="This record is successfully registered!";
  }

  if(!$sqllab)
  {
$_SESSION['error']="Sorry unable to register this record!";
  }
  
  $sqlnet=mysql_query("INSERT INTO network(Lab_Id,School_Id,Availability_Of_LAN,LAN_Supplier,Speed_Of_WAN,Supplied_Date,WAN_Connection_Type,Wired_Date,Internet_Facilities)values('$Lab_Id','$School_Id','$Availability_Of_LAN','$LAN_Supplier','$Speed_Of_WAN','$Supplied_Date','$WAN_Connection_Type','$Wired_Date','$Internet_Facilities')");
  if(!$sqlnet)
  {
$_SESSION['error']="Sorry unable to register the network details record!";
  }
  }
  if($Lab_Id==""||$School_Id==""||$Source_Of_Power==""||$Tp_Number==""||$Account_Number==""||$Date_of_commencement==""||$Availability_Of_LAN==""||$LAN_Supplier==""||$Speed_Of_WAN==""||$Supplied_Date==""||$WAN_Connection_Type==""||$Internet_Facilities=="")
	{
	$_SESSION['errorin']="Please fill all!";
  }
   }
?>
</body>
</html>
